﻿@using GoodMan.Infrastructure.Entities.Entity;
@{
    ViewBag.Title = "楼栋信息";
    Layout = "~/Areas/WorkSpace/Views/Shared/_CollegeAdminTemplete.cshtml";

    ItemListBox<Dormitory> dormitoryList = ViewBag.Dormitorys;
}


<div id="content-header">
    <h1>楼栋信息</h1>
</div>
<div id="breadcrumb">
	<a href="index.html" title="Go to Home" class="tip-bottom"><i class="icon-home"></i>首页</a>
	<a href="/workspace/CollegeAdmin/DormitoryInfoList" class="tip-bottom">楼栋管理</a>
	<a href="/workspace/CollegeAdmin/DormitoryInfoList" class="current">信息列表</a>
</div>
<div class="container-fluid">
  <div class="row-fluid">
     <div class="span12">
     <div class="widget-box">
			<div class="widget-title">			
				<h5>信息列表</h5>
			</div>
            <br />
            <form action="/workspace/collegeadmin/DormitoryInfoList" method="get" name="BusinessForm">
                <div style="width: 500px; margin: 0px auto;">
                    <table border="0" cellpadding="0" cellspacing="0">
                        <tr align="center">
                            
                            <td width="100px">
                                查询关键字
                            </td>
                            <td width="20%">
                                <input type="text" placeholder="输入楼栋名" name="search" value="@ViewBag.Search"  style="width: 200px" class="span4 " />
                            </td>
                            
                            <td>
                                <button type="submit" class="btn btn-primary">
                                    查询</button>
                            </td>
                        </tr>
                    </table>
                </div>
                </form>
			<div class="widget-content nopadding">
				<table class="table table-bordered data-table">
					<thead>
					<tr>
					    <th width="3%">序号</th>
					    <th width="20%">楼栋名</th>
                        <th width="20%">所属学校</th>
                        <th width="10%">创建人</th>
					    <th width="10%">创建时间</th>
                        <th width="37%">操作</th>
					</tr>
					</thead>
					<tbody>
                    @{
                        int index=0;
                        if (dormitoryList != null && dormitoryList.Data != null && dormitoryList.Data.Count != 0)
                        {
                            string collegeName="";
                            foreach (var dormitory in dormitoryList.Data)
                            {
                                index++;
                                if(dormitory.CollegeId==1){
                                    collegeName = "重庆工商大学";
                                }
                               <tr class="gradeX">
					<td>@index</td>
					<td>@dormitory.Name</td>
                    <td>@collegeName</td>
                    <td>@dormitory.Creator</td>
					<td>@dormitory.CreateDate.ToShortDateString()</td>
					<td class="center" style="min-width:200px;">
                        <a href="/CollegeAdmin/DelDormitory?id=@dormitory.Id&page=@dormitoryList.CurrentPage" onclick="if (confirm('确认删除数据？删除后该数据无法恢复！')==true){return true;}else{return false;}" class="btn btn-danger btn-mini">删除</a>
                        </td>
					</tr> 
                            }
                        }else{
                        <tr class="gradeX"><td colspan="6" align="center">没有找到任何数据！</td></tr>
                        }
                        }	 
					</tbody>
					</table>
			</div>
           @Html.Raw(dormitoryList.PageItemSegment)         
		</div>
     </div>
     </div> @{
                        if (ViewBag.isSuccess!=null){
                            if (ViewBag.isSuccess) { 
                                <div class="Success">操作成功！</div>
                            }else{
                                <div class="Error">操作失败！</div>
                            }
                        }
                    }</div>
     @section tail{
     <script type="text/javascript">
         $(function () {
             $('#likDormitory').addClass('open');
             $('#likDormitory').addClass('active');
         });
</script>
}
